package com;

import lombok.extern.slf4j.Slf4j;

public class Main {

    public static void main(String[] args) {
        char[] cs = "luqi".toCharArray();
        boolean[] mark = new boolean[cs.length];
        select(cs, 3, mark, 0);
    }

    public static void select(char[] cs, int num, boolean[] mark, int pos) {
        if (num == 0) {
            for (int i = 0; i < pos; i++) {
                if (mark[i]) {
                    System.out.print(cs[i] + " ");
                }
            }
            System.out.println();
            return;
        }
        if (pos == cs.length) {
            return;
        }
        mark[pos] = true;
        select(cs, num - 1, mark, pos + 1);
        mark[pos] = false;
        select(cs, num, mark, pos + 1);
    }

}
